home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / opbonus.arc / FBROWSE.ARC / FBROWSE.TXT < prev    next >
Text File  |  1991-03-20  |  33KB  |  1,011 lines

  1. ;Help text for FBROWSE unit
  2. ;Copyright (c) 1990, TurboPower Software
  3. ;All rights reserved
  4. ;Version 5.06
  5. ;
  6. !WIDTH 76
  7. ;
  8. ;-------------------------------------------------------------------
  9. !TOPIC 1 FBrowse
  10. FBrowse merges the functionality of B-Tree Filer's Browser unit into
  11. an object based on Object Professional's CommandWindow. The following
  12. hierarchy shows the objects implemented in FBrowse:
  13.  
  14.   [CommandWindow]
  15.     0002FBrowser
  16.       0047VBrowser
  17.  
  18. (The CommandWindow object is implemented in Object Professional's
  19. OpWindow unit.)
  20.  
  21. See also:  0053Commands
  22. ;
  23. ;-------------------------------------------------------------------
  24. !TOPIC 2 FBrowser
  25. !NOINDEX
  26. FBrowser = object(CommandWindow)
  27. !LINE
  28. FBrowserPtr = ^FBrowser;
  29.  
  30. A window-based object used for browsing through datafiles containing
  31. fixed-length records in indexed order. FBrowser offers methods in the
  32. following categories:
  33.  
  34.   0054Declarations                   0072General
  35.   0078Get/set current record         0074Methods to override
  36.   0077Procedures and functions       0073User hooks
  37.   0075Setting options                0076Scrolling
  38. ;
  39. ;-------------------------------------------------------------------
  40. !TOPIC 3 Init
  41. !NOINDEX
  42. constructor 0002FBrowser.Init(X1, Y1, X2, Y2 : Byte;
  43.                           IFBPtr : IsamFileBlockPtr;
  44.                           KeyNum : Integer;
  45.                           var DatS;
  46.                           MaxRows, RowsPerItem : Byte;
  47.                           MaxCols : Word);
  48.  
  49. Initialize a browser with default window options.
  50.  
  51. See also:  0004InitCustom
  52. ;
  53. ;-------------------------------------------------------------------
  54. !TOPIC 4 InitCustom
  55. !NOINDEX
  56. constructor 0002FBrowser.InitCustom(X1, Y1, X2, Y2 : Byte;
  57.                                 var Colors : ColorSet;
  58.                                 Options : LongInt;
  59.                                 IFBPtr : IsamFileBlockPtr;
  60.                                 KeyNum : Integer;
  61.                                 var DatS;
  62.                                 MaxRows, RowsPerItem : Byte;
  63.                                 MaxCols : Word);
  64.  
  65. Initialize a browser with custom window options.
  66.  
  67. See also:  0003Init
  68. ;
  69. ;-------------------------------------------------------------------
  70. !TOPIC 5 Done
  71. !NOINDEX
  72. destructor 0002FBrowser.Done; virtual;
  73.  
  74. Deallocate item records.
  75.  
  76. See also:  0003Init  0004InitCustom
  77. ;
  78. ;-------------------------------------------------------------------
  79. !TOPIC 6 ProcessSelf
  80. !NOINDEX
  81. procedure 0002FBrowser.ProcessSelf; virtual;
  82.  
  83. Process browse commands.
  84. ;
  85. ;-------------------------------------------------------------------
  86. !TOPIC 7 fbOptionsOn
  87. !NOINDEX
  88. procedure 0002FBrowser.fbOptionsOn(OptionFlags : LongInt);
  89.  
  90. Activate multiple options.
  91.  
  92. See also:  0055BadFBrowserOptions  0009fbOptionsAreOn  0008fbOptionsOff  0061Options
  93. ;
  94. ;-------------------------------------------------------------------
  95. !TOPIC 8 fbOptionsOff
  96. !NOINDEX
  97. procedure 0002FBrowser.fbOptionsOff(OptionFlags : LongInt);
  98.  
  99. Deactivate multiple options.
  100.  
  101. See also:  0055BadFBrowserOptions  0009fbOptionsAreOn  0007fbOptionsOn  0061Options
  102. ;
  103. ;-------------------------------------------------------------------
  104. !TOPIC 9 fbOptionsAreOn
  105. !NOINDEX
  106. function 0002FBrowser.fbOptionsAreOn(OptionFlags : LongInt) : Boolean;
  107.  
  108. Return True if all specified options are on.
  109.  
  110. See also:  0007fbOptionsOn  0008fbOptionsOff  0061Options
  111. ;
  112. ;-------------------------------------------------------------------
  113. !TOPIC 10 GetFileBlockPtr
  114. !NOINDEX
  115. function 0002FBrowser.GetFileBlockPtr : IsamFileBlockPtr;
  116.  
  117. Get pointer to associated fileblock.
  118.  
  119. See also:  0004InitCustom
  120. ;
  121. ;-------------------------------------------------------------------
  122. !TOPIC 11 GetKeyNumber
  123. !NOINDEX
  124. function 0002FBrowser.GetKeyNumber : Integer;
  125.  
  126. Get current index key number.
  127.  
  128. See also:  0020SetKeyNumber
  129. ;
  130. ;-------------------------------------------------------------------
  131. !TOPIC 12 GetCurrentItem
  132. !NOINDEX
  133. function 0002FBrowser.GetCurrentItem : Byte;
  134.  
  135. Get number of currently highlighted item.
  136.  
  137. See also:  0013GetCurrentCol  0017GetItemString
  138. ;
  139. ;-------------------------------------------------------------------
  140. !TOPIC 13 GetCurrentCol
  141. !NOINDEX
  142. function 0002FBrowser.GetCurrentCol : Word;
  143.  
  144. Get column currently displayed at left edge of window.
  145.  
  146. See also:
  147.   0012GetCurrentItem  0014GetFirstCol  0032SetScreenUpdateProc
  148. ;
  149. ;-------------------------------------------------------------------
  150. !TOPIC 14 GetFirstCol
  151. !NOINDEX
  152. function 0002FBrowser.GetFirstCol : Word;
  153.  
  154. Get number of first column of data that needs to be loaded into memory by
  155. the build item routine.
  156.  
  157. See also:  0013GetCurrentCol  0027SetBuildItemProc
  158. ;
  159. ;-------------------------------------------------------------------
  160. !TOPIC 15 GetCurrentKeyAndRef
  161. !NOINDEX
  162. procedure 0002FBrowser.GetCurrentKeyAndRef(var Key : IsamKeyStr;
  163.                                        var Ref : LongInt);
  164.  
  165. Retrieve current key and record number.
  166.  
  167. See also:  0016GetCurrentRecord
  168. ;
  169. ;-------------------------------------------------------------------
  170. !TOPIC 16 GetCurrentRecord
  171. !NOINDEX
  172. procedure 0002FBrowser.GetCurrentRecord(var DatS; var DatLen : Word);
  173.  
  174. Retrieve current record.
  175.  
  176. See also:
  177.   0015GetCurrentKeyAndRef  0044GetRecord  0018SetCurrentRecord
  178. ;
  179. ;-------------------------------------------------------------------
  180. !TOPIC 17 GetItemString
  181. !NOINDEX
  182. function 0002FBrowser.GetItemString(Item, Row : Byte) : string; virtual;
  183.  
  184. Get string corresponding to specified Row of specified Item.
  185.  
  186. See also:  0012GetCurrentItem
  187. ;
  188. ;-------------------------------------------------------------------
  189. !TOPIC 18 SetCurrentRecord
  190. !NOINDEX
  191. procedure 0002FBrowser.SetCurrentRecord(Key : IsamKeyStr; Ref : LongInt);
  192.  
  193. Set the current record.
  194.  
  195. See also:  0034CharHook  0016GetCurrentRecord
  196. ;
  197. ;-------------------------------------------------------------------
  198. !TOPIC 19 SetKeyRange
  199. !NOINDEX
  200. procedure 0002FBrowser.SetKeyRange(LowKey, HighKey : IsamKeyStr);
  201.  
  202. Set subrange of valid keys.
  203.  
  204. See also:  0020SetKeyNumber
  205. ;
  206. ;-------------------------------------------------------------------
  207. !TOPIC 20 SetKeyNumber
  208. !NOINDEX
  209. procedure 0002FBrowser.SetKeyNumber(KeyNum : Integer);
  210.  
  211. Switch index keys.
  212.  
  213. See also:  0011GetKeyNumber  0019SetKeyRange
  214. ;
  215. ;-------------------------------------------------------------------
  216. !TOPIC 21 SetRetries
  217. !NOINDEX
  218. procedure 0002FBrowser.SetRetries(Retries : Integer);
  219.  
  220. Set number of times to retry on read operations.
  221.  
  222. See also:  0058DefRetriesOnLock
  223. ;
  224. ;-------------------------------------------------------------------
  225. !TOPIC 22 SetNormAttr
  226. !NOINDEX
  227. procedure 0002FBrowser.SetNormAttr(Color, Mono : Byte);
  228.  
  229. Set attribute for unselected items.
  230.  
  231. See also:  0023SetSelectAttr
  232. ;
  233. ;-------------------------------------------------------------------
  234. !TOPIC 23 SetSelectAttr
  235. !NOINDEX
  236. procedure 0002FBrowser.SetSelectAttr(Color, Mono : Byte);
  237.  
  238. Set attribute for selected items.
  239.  
  240. See also:  0022SetNormAttr
  241. ;
  242. ;-------------------------------------------------------------------
  243. !TOPIC 24 SetHorizScrollDelta
  244. !NOINDEX
  245. procedure 0002FBrowser.SetHorizScrollDelta(Delta : Byte);
  246.  
  247. Set columns to jump when scrolling horizontally.
  248.  
  249. See also:  0026SetHorizScrollBarDelta  0025SetVertScrollDelta
  250. ;
  251. ;-------------------------------------------------------------------
  252. !TOPIC 25 SetVertScrollDelta
  253. !NOINDEX
  254. procedure 0002FBrowser.SetVertScrollDelta(Delta : Byte);
  255.  
  256. Set rows (items) to jump when scrolling vertically.
  257.  
  258. See also:  0024SetHorizScrollDelta
  259. ;
  260. ;-------------------------------------------------------------------
  261. !TOPIC 26 SetHorizScrollBarDelta
  262. !NOINDEX
  263. procedure 0002FBrowser.SetHorizScrollBarDelta(Delta : Byte);
  264.  
  265. Set columns to jump when scrolling horizontally (using scroll bar).
  266.  
  267. See also:  0024SetHorizScrollDelta
  268. ;
  269. ;-------------------------------------------------------------------
  270. !TOPIC 27 SetBuildItemProc
  271. !NOINDEX
  272. procedure 0002FBrowser.SetBuildItemProc(BIF : BuildItemProc);
  273.  
  274. Set procedure to build an item. A build item procedure must be of the
  275. following form:
  276.  
  277.   {$F+}
  278.   procedure BuildItem(Row : Byte; var DatS; Len : Word;
  279.                       RecNum : LongInt; Key : IsamKeyStr;
  280.                       var S : string; FBP : FBrowserPtr);
  281.   begin
  282.     S := ????;
  283.   end;
  284.  
  285. See also:
  286.   0065BuildItemProc  0040BuildOneItem
  287.   0079BuildOneRow    0014GetFirstCol
  288. ;
  289. ;-------------------------------------------------------------------
  290. !TOPIC 28 SetFilterFunc
  291. !NOINDEX
  292. procedure 0002FBrowser.SetFilterFunc(FF : FilterFunc);
  293.  
  294. Set record filtering function. A filter function must be of the following
  295. form:
  296.  
  297.   {$F+}
  298.   function MyFilter(RecNum : LongInt; Key : IsamKeyStr;
  299.                     FBP : FBrowserPtr) : Boolean;
  300.   begin
  301.   end;
  302.  
  303. See also:
  304.   0066FilterFunc                     0029IsFilteringEnabled
  305.   0049NullFilterFunc                 0041RecordFilter
  306.   0019SetKeyRange
  307. ;
  308. ;-------------------------------------------------------------------
  309. !TOPIC 29 IsFilteringEnabled
  310. !NOINDEX
  311. function 0002FBrowser.IsFilteringEnabled : Boolean; virtual;
  312.  
  313. Return True if filtering is enabled.
  314.  
  315. See also:  0041RecordFilter  0028SetFilterFunc
  316. ;
  317. ;-------------------------------------------------------------------
  318. !TOPIC 30 SetSpecialTaskProc
  319. !NOINDEX
  320. procedure 0002FBrowser.SetSpecialTaskProc(STP : SpecialTaskProc);
  321.  
  322. Set user-defined special task hook. A special task procedure must be of the
  323. following form:
  324.  
  325.   {$F+}
  326.   procedure MySpecialTask(RecNum : LongInt; Key : IsamKeyStr;
  327.                           FBP : FBrowserPtr);
  328.   begin
  329.     { FBP^.SetLastCommand(ccNone); }
  330.   end;
  331.  
  332. See also:  0042SpecialTask  0068SpecialTaskProc
  333. ;
  334. ;-------------------------------------------------------------------
  335. !TOPIC 31 SetPreMoveProc
  336. !NOINDEX
  337. procedure 0002FBrowser.SetPreMoveProc(PMP : SpecialTaskProc);
  338.  
  339. Set user-defined procedure to call before each command. A pre-move procedure
  340. must be of the following form:
  341.  
  342.   {$F+}
  343.   procedure MyPreMove(RecNum : LongInt; Key : IsamKeyStr;
  344.                       FBP : FBrowserPtr);
  345.   begin
  346.   end;
  347.  
  348. See also:  0038PreMove  0068SpecialTaskProc
  349. ;
  350. ;-------------------------------------------------------------------
  351. !TOPIC 32 SetScreenUpdateProc
  352. !NOINDEX
  353. procedure 0002FBrowser.SetScreenUpdateProc(SUP : UpdateProc);
  354.  
  355. Set user-defined procedure to call on each screen update. A screen update
  356. procedure must be of the following form:
  357.  
  358.   {$F+}
  359.   procedure MyScreenUpdate(FBP : FBrowserPtr);
  360.   begin
  361.   end;
  362.  
  363. See also:  0037ScreenUpdate  0069UpdateProc
  364. ;
  365. ;-------------------------------------------------------------------
  366. !TOPIC 33 SetRefreshFunc
  367. !NOINDEX
  368. procedure 0002FBrowser.SetRefreshFunc(RF : RefreshFunc);
  369.  
  370. Set routine called to determine if screen refresh is needed. A refresh
  371. function must be of the following form:
  372.  
  373.   {$F+}
  374.   function MyRefreshFunc(FBP : FBrowserPtr) : Boolean;
  375.   begin
  376.   end;
  377.  
  378. See also:
  379.   0043NeedRefresh                    0050NullRefreshFunc
  380.   0051RefreshAtEachCommand           0067RefreshFunc
  381.   0052RefreshPeriodically
  382. ;
  383. ;-------------------------------------------------------------------
  384. !TOPIC 34 CharHook
  385. !NOINDEX
  386. procedure 0002FBrowser.CharHook; virtual;
  387.  
  388. Called each time a regular character is entered by user.
  389.  
  390. See also:  0015GetCurrentKeyAndRef  0018SetCurrentRecord
  391. ;
  392. ;-------------------------------------------------------------------
  393. !TOPIC 35 CursorLeft
  394. !NOINDEX
  395. procedure 0002FBrowser.CursorLeft; virtual;
  396.  
  397. Called to process the ccLeft command.
  398.  
  399. See also:  0036CursorRight  0013GetCurrentCol
  400. ;
  401. ;-------------------------------------------------------------------
  402. !TOPIC 36 CursorRight
  403. !NOINDEX
  404. procedure 0002FBrowser.CursorRight; virtual;
  405.  
  406. Called to process the ccRight command.
  407.  
  408. See also:  0035CursorLeft  0013GetCurrentCol
  409. ;
  410. ;-------------------------------------------------------------------
  411. !TOPIC 37 ScreenUpdate
  412. !NOINDEX
  413. procedure 0002FBrowser.ScreenUpdate; virtual;
  414.  
  415. Called on each screen update; when current item/column changes.
  416.  
  417. See also:  0032SetScreenUpdateProc
  418. ;
  419. ;-------------------------------------------------------------------
  420. !TOPIC 38 PreMove
  421. !NOINDEX
  422. procedure 0002FBrowser.PreMove; virtual;
  423.  
  424. Called just prior to getting each keyboard command.
  425.  
  426. See also:  0031SetPreMoveProc
  427. ;
  428. ;-------------------------------------------------------------------
  429. !TOPIC 39 DrawItem
  430. !NOINDEX
  431. procedure 0002FBrowser.DrawItem(Item : Byte; Highlight : Boolean); virtual;
  432.  
  433. Draw the specified (relative) Item of the browse window.
  434. ;
  435. ;-------------------------------------------------------------------
  436. !TOPIC 40 BuildOneItem
  437. !NOINDEX
  438. procedure 0002FBrowser.BuildOneItem(Item : Byte; Locked : Boolean); virtual;
  439.  
  440. Convert specified item to a string.
  441.  
  442. See also:  0027SetBuildItemProc
  443. ;
  444. ;-------------------------------------------------------------------
  445. !TOPIC 41 RecordFilter
  446. !NOINDEX
  447. function 0002FBrowser.RecordFilter(RecNum : LongInt;
  448.                                Key : IsamKeyStr) : Boolean; virtual;
  449.  
  450. Return True if this record should be displayed.
  451.  
  452. See also:  0028SetFilterFunc
  453. ;
  454. ;-------------------------------------------------------------------
  455. !TOPIC 42 SpecialTask
  456. !NOINDEX
  457. procedure 0002FBrowser.SpecialTask; virtual;
  458.  
  459. Special task hook.
  460.  
  461. See also:  0030SetSpecialTaskProc
  462. ;
  463. ;-------------------------------------------------------------------
  464. !TOPIC 43 NeedRefresh
  465. !NOINDEX
  466. function 0002FBrowser.NeedRefresh : Boolean; virtual;
  467.  
  468. Called to see if the display needs to be refreshed.
  469.  
  470. See also:  0033SetRefreshFunc
  471. ;
  472. ;-------------------------------------------------------------------
  473. !TOPIC 44 GetRecord
  474. !NOINDEX
  475. procedure 0002FBrowser.GetRecord(Ref : LongInt; var DatS;
  476.                              var Len : Word); virtual;
  477.  
  478. Low-level routine to read a specific record.
  479.  
  480. See also:  0016GetCurrentRecord
  481. ;
  482. ;-------------------------------------------------------------------
  483. !TOPIC 45 Load
  484. !NOINDEX
  485. constructor 0002FBrowser.Load(var S : IdStream);
  486.  
  487. Load a file browser from a stream.
  488.  
  489. See also:  0046Store
  490. ;
  491. ;-------------------------------------------------------------------
  492. !TOPIC 46 Store
  493. !NOINDEX
  494. procedure 0002FBrowser.Store(var S : IdStream);
  495.  
  496. Store a file browser in a stream.
  497.  
  498. See also:  0045Load
  499. ;
  500. ;-------------------------------------------------------------------
  501. !TOPIC 47 VBrowser
  502. !NOINDEX
  503. VBrowser = object(0002FBrowser)
  504. !LINE
  505. VBrowserPtr = ^VBrowser;
  506.  
  507. A window-based object used for browsing through datafiles containing
  508. variable-length records in indexed order.
  509.  
  510. See also:  0048GetRecord
  511. ;
  512. ;-------------------------------------------------------------------
  513. !TOPIC 48 GetRecord
  514. !NOINDEX
  515. procedure 0047VBrowser.GetRecord(Ref : LongInt; var DatS;
  516.                              var Len : Word); virtual;
  517.  
  518. Low-level routine to read a specific record.
  519.  
  520. See also:  0044FBrowser.GetRecord
  521. ;
  522. ;-------------------------------------------------------------------
  523. !TOPIC 49 NullFilterFunc
  524. !NOINDEX
  525. function 0001FBrowse.NullFilterFunc(RecNum : LongInt; Key : IsamKeyStr;
  526.                                 FBP : FBrowserPtr) : Boolean;
  527.  
  528. Do-nothing record filtering function.
  529.  
  530. See also:  0028FBrowser.SetFilterFunc
  531. ;
  532. ;-------------------------------------------------------------------
  533. !TOPIC 50 NullRefreshFunc
  534. !NOINDEX
  535. function 0001FBrowse.NullRefreshFunc(FBP : FBrowserPtr) : Boolean;
  536.  
  537. Do-nothing refresh function.
  538.  
  539. See also:  0033FBrowser.SetRefreshFunc
  540. ;
  541. ;-------------------------------------------------------------------
  542. !TOPIC 51 RefreshAtEachCommand
  543. !NOINDEX
  544. function 0001FBrowse.RefreshAtEachCommand(FBP : FBrowserPtr) : Boolean;
  545.  
  546. Check for need to refresh before each command if no keystrokes pending.
  547.  
  548. See also:  0033FBrowser.SetRefreshFunc
  549. ;
  550. ;-------------------------------------------------------------------
  551. !TOPIC 52 RefreshPeriodically
  552. !NOINDEX
  553. function 0001FBrowse.RefreshPeriodically(FBP : FBrowserPtr) : Boolean;
  554.  
  555. Check for need to refresh every RefreshPeriod clock ticks.
  556.  
  557. See also:  0033FBrowser.SetRefreshFunc  0071RefreshPeriod
  558. ;
  559. ;------------------------------------------------------------
  560. !TOPIC 53 Commands
  561. !NOINDEX
  562. !NOSEARCH
  563. 0002FBrowser's Process method offers appropriate commands to browse
  564. through a B-Tree Filer data file. The list below arranges them by
  565. category. In each case the first line gives the name of the command,
  566. followed by the key(s) to which it is normally assigned. The second and
  567. following lines give a brief description of the command.
  568.  
  569. !NOWRAP
  570. ccLeft         <Left>, <CtrlS>
  571. Scroll window left 1 column.
  572.  
  573. ccRight        <Right>, <CtrlD>
  574. Scroll window right 1 column.
  575.  
  576. ccHome         <Home>, <CtrlQ><S>
  577. Scroll window to column 1.
  578.  
  579. ccEnd          <End>, <CtrlQ><D>
  580. Scroll window to rightmost column, so that the end of each row is displayed.
  581.  
  582. ccUp           <Up>, <CtrlE>, <CtrlW>
  583. Scroll window up one item.
  584.  
  585. ccDown         <Down>, <CtrlX>, <CtrlZ>
  586. Scroll window down one item.
  587.  
  588. ccPageUp       <PgUp>, <CtrlR>
  589. Scroll window up one page.
  590.  
  591. ccPageDn       <PgDn>, <CtrlC>
  592. Scroll window down one page.
  593.  
  594. ccFirstRec     <CtrlPgUp>, <CtrlQ><R>
  595. Scroll to first record in file.
  596.  
  597. ccLastRec      <CtrlPgDn>, <CtrlQ><C>
  598. Scroll to last record in file.
  599.  
  600. ccPlus         <+>
  601. Rebuild and redisplay the current page.
  602.  
  603. ccSelect       <Enter>, <CtrlM>
  604. Select the currently highlighted item.
  605.  
  606. ccQuit         <CtrlBreak>, <Esc>, <ClickRight>
  607. Quit browsing.
  608.  
  609. !NOWRAP
  610. ccHelp         <F1>, <ClickBoth>
  611. !WRAP
  612. Help. If a user-written help routine has been established by calling
  613. 0070FBrowserCommands.SetHelpProc, pressing <F1> will call that routine;
  614. otherwise this command does nothing. If there is a help procedure, the
  615. 0002FBrowser will pass it the following three parameters: ucFBrowser,
  616. @Self, and the value designated as the window's help index (see
  617. CommandWindow.SetHelpIndex), which defaults to 0.
  618.  
  619. !NOWRAP
  620. ccMouseSel     <ClickLeft>
  621. !WRAP
  622. Move the highlight bar to the position indicated by the mouse, if possible. If
  623. the highlight bar is already over the indicated item, it will be selected,
  624. just as it would if <Enter> were pressed. This command may also be used to
  625. scroll the display by clicking on a scroll bar.
  626.  
  627.  
  628. See also:  0056Command codes  0070FBrowserCommands  0006FBrowser.ProcessSelf
  629. ;
  630. ;-------------------------------------------------------------------
  631. !TOPIC 54 Declarations
  632. !NOINDEX
  633. !NOSEARCH
  634. FBrowse provides the following types, constants, and variables for working
  635. with 0002FBrowsers:
  636.  
  637.     0055BadFBrowserOptions                0065BuildItemProc
  638.     0056Command codes                     0062Configuration data
  639.     0057DefFBrowserOptions                0058DefRetriesOnLock
  640.     0059Error codes                       0060Error messages
  641.     0070FBrowserCommands                  0066FilterFunc
  642.     0063Object type codes                 0061Options
  643.     0067RefreshFunc                       0071RefreshPeriod
  644.     0068SpecialTaskProc                   0064Unit code
  645.     0069UpdateProc
  646. ;
  647. ;------------------------------------------------------------
  648. !TOPIC 55 BadFBrowserOptions
  649. !NOINDEX
  650. const
  651.   BadFBrowserOptions : LongInt =
  652.     fbLockPending+fbForceRedraw+fbIsNet+fbInProcess;
  653.  
  654. 0002FBrowser options that exist for internal use, and may not be altered
  655. by calling fbOptionsOn or fbOptionsOff.
  656.  
  657. See also:  0061Options
  658. ;
  659. ;------------------------------------------------------------
  660. !TOPIC 56 Command codes
  661. !NOINDEX
  662. !NOSEARCH
  663. const
  664.   ccFirstRec  = ccTopOfFile; {Move cursor to first record}
  665.   ccLastRec   = ccEndOfFile; {Move cursor to last record}
  666.   ccPlus      = ccToggle;    {Rebuild and redraw current page}
  667.   ccTask0     = 180;         {user-defined task commands}
  668.   ...
  669.   ccTask19    = 199;
  670.  
  671. Command codes unique to FBrowse.
  672.  
  673. See also:  0053Commands
  674. ;
  675. ;------------------------------------------------------------
  676. !TOPIC 57 DefFBrowserOptions
  677. !NOINDEX
  678. const
  679.   DefFBrowserOptions : LongInt = fbMousePage+fbDrawActive+fbAutoScale;
  680.  
  681. The default options for an 0002FBrowser or 0047VBrowser.
  682.  
  683. See also:  0061Options
  684. ;
  685. ;------------------------------------------------------------
  686. !TOPIC 58 DefRetriesOnLock
  687. !NOINDEX
  688. const
  689.   DefRetriesOnLock : Integer = 50;
  690.  
  691. Default number of times to retry following a lock error.
  692.  
  693. See also:  0021FBrowser.SetRetries
  694. ;
  695. ;------------------------------------------------------------
  696. !TOPIC 59 Error codes
  697. !NOINDEX
  698. !NOSEARCH
  699. const
  700.   ecWinTooSmall  = 06000; {init error--window/max rows too small}
  701.   ecNoIndex      = 06001; {init error--Fileblock is not indexed}
  702.   ecIsamError    = 06002; {fatal Isam error--IsamError has actual code}
  703.   ecNoKeysFound  = 06003; {no keys found in requested range}
  704.   ecRecordGone   = 06004; {tried to select record that no longer exists}
  705.   ecRecordLocked = 06005; {tried to select record and lock error occurred}
  706.   ecFileBlockLocked = 06006; {non-fatal error due to locked fileblock}
  707.  
  708. Codes for errors reported only by 0002FBrowser-based objects.
  709.  
  710. See also:  0060Error messages
  711. ;
  712. ;------------------------------------------------------------
  713. !TOPIC 60 Error messages
  714. !NOINDEX
  715. !NOSEARCH
  716. const
  717.   emIsamError    : string[40] =
  718.     'Fatal error accessing data or index file';
  719.   emNoKeysFound  : string[35] =
  720.     'No records found in specified range';
  721.   emRecordGone   : string[32] =
  722.     'Selected record no longer exists';
  723.   emRecordLocked : string[40] =
  724.     'Lock error while reading selected record';
  725.   emFileBlockLocked :
  726.     string[14] = 'File is locked';
  727.  
  728. The default error messages corresponding to the ecIsamError, ecNoKeysFound,
  729. ecRecordGone, ecRecordLocked, and ecFileBlockLocked errors, respectively.
  730.  
  731. See also:  0059Error codes
  732. ;
  733. ;------------------------------------------------------------
  734. !TOPIC 61 Options
  735. !NOINDEX
  736. !NOSEARCH
  737. const
  738.   fbScrollByPage   = $00000001; {scroll by page on Up/Down?}
  739.   fbMousePage      = $00000002; {clicking on scroll bar scrolls by page}
  740.   fbDrawActive     = $00000004; {Draw and Process leave sel item visible}
  741.   fbUseReadLock    = $00000008; {use read locks while building pages?}
  742.   fbAutoScale      = $00000010; {scale scroll bar based on low/high keys?}
  743.   fbForceUpdate    = $00000020; {force the screen to be updated}
  744.   fbFlushKbd       = $00000040; {flush keyboard buffer at boundaries}
  745.   fbBellOnFlush    = $00000080; {ring bell when flushing?}
  746.   fbBuildOnKey     = $00000100; {build item function needs only the key}
  747.   fbLockPending    = $10000000; {internal flags}
  748.   fbForceRedraw    = $20000000;
  749.   fbIsNet          = $40000000;
  750.   fbInProcess      = $80000000;
  751.  
  752. These are the options that affect the behavior of an 0002FBrowser.
  753. fbScrollByPage affects the vertical scrolling behavior of an FBrowser when
  754. the cursor is moved (using <Up> or <Down>) to an item not currently on
  755. screen. If the option is off, the window will be scrolled only enough to
  756. display the new item. If it is on, the window will be scrolled one full
  757. page. fbMousePage determines what happens when the user clicks on the up and
  758. down arrows of a scroll bar. If the option is off, the highlight will be
  759. moved up or down by a single item; if it is on, the highlight will be moved
  760. up or down one full page.
  761.  
  762. If the fbDrawActive option is on, the current item will be highlighted at
  763. all times; if it is off, the item will be highlighted only while the Process
  764. method is active. If the fbUseReadLock option is on, the Fileblock in use
  765. will be read-locked while building pages and scrolling. The fbAutoScale
  766. option affects the behavior of vertical scroll bars in cases where a low and
  767. high key have been specified with SetKeyRange. If it is on, the scroll bar's
  768. scale is based on the positions within the current index of the first and
  769. last record within the range. If it is off, the scale is based on the total
  770. number of records in the current index. The fbForceUpdate option must be set
  771. any time that you call either Draw or Process after adding, deleting, or
  772. modifying a record in the data file being browsed.
  773.  
  774. The fbFlushKbd and fbBellOnFlush options are intended primarily for use in
  775. multi-user applications, to avoid the common problem that occurs when the
  776. user holds down one of the cursor keys too long. When the end of the
  777. database is reached, the browser will appear to hang because it's spending
  778. all of its time processing commands that don't affect the display. The
  779. fbFlushKbd option simply tells FBrowser to try to avoid this problem by
  780. flushing the keyboard buffer when a cursor command fails to scroll the
  781. display. The fbBellOnFlush option tells it to "ring the bell" each time a
  782. keystroke is flushed from the keyboard buffer. The fbBuildOnKey option tells
  783. the browser that the build item routine can do its job given only an index
  784. key, and doesn't need the actual record.
  785.  
  786. The remaining options--fbLockPending, fbForceRedraw, fbIsNet, and
  787. fbInProcess--are intended strictly for internal use.
  788.  
  789. See also:  0055BadFBrowserOptions  0057DefFBrowserOptions
  790. ;
  791. ;------------------------------------------------------------
  792. !TOPIC 62 Configuration data
  793. !NOINDEX
  794. !NOSEARCH
  795. const
  796.   FBrowserKeyMax = 200;
  797.   FBrowserKeyID  : string[13] = 'fbrowser keys';
  798.   FBrowserKeySet : array[0..FBrowserKeyMax] of Byte = (...);
  799.   FBrowserCfgEnd : Byte = 0;
  800.  
  801. FBrowserKeyId is an ID string used to mark the beginning of the
  802. configuration data area for FBrowse; FBrowserCfgEnd marks the end of the
  803. data area. In between them is FBrowserKeySet, the command table used by
  804. 0070FBrowserCommands. FBrowserKeyMax is the last valid index into the table.
  805. ;
  806. ;------------------------------------------------------------
  807. !TOPIC 63 Object type codes
  808. !NOINDEX
  809. !NOSEARCH
  810. const
  811.   otFBrowser         = 999;
  812.   veFBrowser         = 0;
  813.   otVBrowser         = 998;
  814.   veVBrowser         = 0;
  815.   ptFBrowserCommands = 999;
  816.   ptNullFilterFunc   = 998;
  817.   ptNullRefreshFunc  = 997;
  818.  
  819. Object type, version, and pointer type codes used internally when storing an
  820. 0002FBrowser in a stream.
  821. ;
  822. ;------------------------------------------------------------
  823. !TOPIC 64 Unit code
  824. !NOINDEX
  825. !NOSEARCH
  826. const
  827.   ucFBrowser = 99;
  828.  
  829. FBrowse's unit code, which is passed to the help routine (if any) when the
  830. ccHelp command is issued.
  831.  
  832. See also:  0053Commands
  833. ;
  834. ;------------------------------------------------------------
  835. !TOPIC 65 BuildItemProc
  836. !NOINDEX
  837. type
  838.   BuildItemProc =
  839.     procedure (Row : Byte; var DatS; Len : Word; RecNum : LongInt;
  840.                Key : IsamKeyStr; var S : string; FBP : FBrowserPtr);
  841.  
  842. A user-written routine that builds the string(s) corresponding to a given
  843. item (record).
  844.  
  845. See also:  0027FBrowser.SetBuildItemProc
  846. ;
  847. ;------------------------------------------------------------
  848. !TOPIC 66 FilterFunc
  849. !NOINDEX
  850. type
  851.   FilterFunc =
  852.     function (RecNum : LongInt; Key : IsamKeyStr;
  853.               FBP : FBrowserPtr) : Boolean;
  854.  
  855. A user-written routine that is called to determine whether or not a given
  856. record should be displayed.
  857.  
  858. See also:  0028FBrowser.SetFilterFunc
  859. ;
  860. ;------------------------------------------------------------
  861. !TOPIC 67 RefreshFunc
  862. !NOINDEX
  863. type
  864.   RefreshFunc = function (FBP : FBrowserPtr) : Boolean;
  865.  
  866. A user-written routine that is called just before asking for the next
  867. command.
  868.  
  869. See also:  0033FBrowser.SetRefreshFunc
  870. ;
  871. ;------------------------------------------------------------
  872. !TOPIC 68 SpecialTaskProc
  873. !NOINDEX
  874. type
  875.   SpecialTaskProc =
  876.     procedure (RecNum : LongInt; Key : IsamKeyStr; FBP : FBrowserPtr);
  877.  
  878. A user-written routine that is called when one of the special task commands
  879. (ccTask0..ccTask19) is issued. A pre-move procedure is also of this type.
  880.  
  881. See also:  0030FBrowser.SetSpecialTaskProc
  882. ;
  883. ;------------------------------------------------------------
  884. !TOPIC 69 UpdateProc
  885. !NOINDEX
  886. type
  887.   UpdateProc = procedure (FBP : FBrowserPtr);
  888.  
  889. A user-written routine that is called each time the browser's window is
  890. redrawn or scrolled.
  891.  
  892. See also:  0032FBrowser.SetScreenUpdateProc
  893. ;
  894. ;------------------------------------------------------------
  895. !TOPIC 70 FBrowserCommands
  896. !NOINDEX
  897. var
  898.  {$IFDEF UseDrag}
  899.   FBrowserCommands : DragProcessor;
  900.  {$ELSE}
  901.   FBrowserCommands : CommandProcessor;
  902.  {$ENDIF}
  903.  
  904. The default CommandProcessor for an 0002FBrowser.
  905.  
  906. See also:  0053Commands
  907. ;
  908. ;------------------------------------------------------------
  909. !TOPIC 71 RefreshPeriod
  910. !NOINDEX
  911. var
  912.   RefreshPeriod : Word = 18*5;
  913.  
  914. This typed constant tells the RefreshPeriodically function how often to
  915. check to see if the display needs to be refreshed. The value is in clock
  916. ticks (roughly 18/second), so the default setting requests that checks be
  917. made every five seconds.
  918.  
  919. See also:  0052RefreshPeriodically
  920. ;
  921. ;------------------------------------------------------------
  922. !TOPIC 72 General
  923. !NOINDEX
  924. !NOSEARCH
  925. 0002FBrowser provides the following general purpose methods:
  926.  
  927.   0005Done                           0010GetFileBlockPtr
  928.   0017GetItemString                  0011GetKeyNumber
  929.   0003Init                           0004InitCustom
  930.   0045Load                           0006ProcessSelf
  931.   0020SetKeyNumber                   0019SetKeyRange
  932.   0046Store
  933. ;
  934. ;------------------------------------------------------------
  935. !TOPIC 73 User hooks
  936. !NOINDEX
  937. !NOSEARCH
  938. 0002FBrowser provides the following hooks that allow the programmer to
  939. customize the behavior of the browser for a particular application:
  940.  
  941.   0029IsFilteringEnabled             0027SetBuildItemProc
  942.   0028SetFilterFunc                  0031SetPreMoveProc
  943.   0033SetRefreshFunc                 0032SetScreenUpdateProc
  944.   0030SetSpecialTaskProc
  945. ;
  946. ;------------------------------------------------------------
  947. !TOPIC 74 Methods to override
  948. !NOINDEX
  949. !NOSEARCH
  950. The following virtual methods may be overridden by descendents of
  951. 0002FBrowser:
  952.  
  953.   0040BuildOneItem                   0079BuildOneRow
  954.   0034CharHook                       0035CursorLeft
  955.   0036CursorRight                    0039DrawItem
  956.   0044GetRecord                      0043NeedRefresh
  957.   0038PreMove                        0041RecordFilter
  958.   0037ScreenUpdate                   0042SpecialTask
  959. ;
  960. ;------------------------------------------------------------
  961. !TOPIC 75 Setting options
  962. !NOINDEX
  963. !NOSEARCH
  964. 0002FBrowser provides the following methods for setting options:
  965.  
  966.   0009fbOptionsAreOn                 0008fbOptionsOff
  967.   0007fbOptionsOn                    0022SetNormAttr
  968.   0021SetRetries                     0023SetSelectAttr
  969. ;
  970. ;------------------------------------------------------------
  971. !TOPIC 76 Scrolling
  972. !NOINDEX
  973. !NOSEARCH
  974. 0002FBrowser provides the following methods relating to horizontal and
  975. vertical scrolling:
  976.  
  977.   0013GetCurrentCol                  0014GetFirstCol
  978.   0026SetHorizScrollBarDelta         0024SetHorizScrollDelta
  979.   0025SetVertScrollDelta
  980. ;
  981. ;------------------------------------------------------------
  982. !TOPIC 77 Procedures and functions
  983. !NOINDEX
  984. !NOSEARCH
  985. The following procedures and functions may be used in conjunction with an
  986. 0002FBrowser:
  987.  
  988.   0049NullFilterFunc                 0050NullRefreshFunc
  989.   0051RefreshAtEachCommand           0052RefreshPeriodically
  990. ;
  991. ;------------------------------------------------------------
  992. !TOPIC 78 Get/set current record
  993. !NOINDEX
  994. !NOSEARCH
  995. 0002FBrowser provides the following methods for getting and setting the
  996. current record:
  997.  
  998.   0012GetCurrentItem                 0015GetCurrentKeyAndRef
  999.   0016GetCurrentRecord               0018SetCurrentRecord
  1000. ;
  1001. ;-------------------------------------------------------------------
  1002. !TOPIC 79 BuildOneRow
  1003. !NOINDEX
  1004. procedure 0002FBrowser.BuildOneRow(Row : Byte; var DatS; Len : Word;
  1005.                                RecNum : LongInt; Key : IsamKeyStr;
  1006.                                var S : string); virtual;
  1007.  
  1008. Convert specified row of specified item to a string.
  1009.  
  1010. See also:  0027SetBuildItemProc
  1011.